package cn.group7.padserver.service.impl;

import cn.group7.padserver.dao.BankUserDao;
import cn.group7.padserver.pojo.BankUser;
import cn.group7.padserver.service.BankUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 谷汉斌
 * @description
 * @createTime 2024/8/4 下午9:42
 */
@Service
public class BankUserServiceImpl implements BankUserService {

    @Autowired
    private BankUserDao bankUserDao;

    private Integer bankid;

    @Override
    public List<BankUser> selectAllBankUser(Integer bankid) {
        return bankUserDao.selectAllBankUser(bankid);
    }

    @Override
    public BankUser selectByUserName(String userName) {
        return bankUserDao.selectByPrimaryKey(userName);
    }

    @Override
    public boolean update(BankUser bankUser) {
        return bankUserDao.updateByPrimaryKeySelective(bankUser) == 1;
    }

    @Override
    public boolean add(BankUser bankUser) {
        return bankUserDao.insertSelective(bankUser) == 1;
    }

    @Override
    public boolean delete(String userName) {
        return bankUserDao.deleteByPrimaryKey(userName) == 1;
    }
}
